//
//  AppTools.h
//  UI_Custom
//
//  Created by yutao on 15/9/9.
//  Copyright (c) 2015年 yutao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

//下面这两个block是请求字典或者数组类型数据用的
typedef void(^AppToolsBlockSuccess)(id result);
typedef void(^AppToolsBlockFailure)(NSError *error);
typedef void(^AFNetBlock)(id content);
typedef void(^AFNetFailure)(NSError *error);
//下面的block是用来请求图片用的
typedef void(^DownImageBlock)(NSData *data);


@interface AppTools : NSObject

//模仿AFN请求数据
//AFN是用来请求大字典或者大数组这样的json数据
//请求图片可以用下面DownLoadImageWithURL:的方法
+(void)GetURLWithString:(NSString *)urlStr SuccessBlock:(AppToolsBlockSuccess)successBlock andFailureBlock:(AppToolsBlockFailure)failureBlock;


//请求图片的方法
+(void)DownLoadImageWithURL:(NSString *)urlStr Block:(DownImageBlock)block;

+(void)getAFNetWorkingData:(NSString *)url Block:(AFNetBlock)block FailureBlock:(AFNetFailure)failureBlock;


@end









